package com.ken.mall.controller;

import com.ken.mall.comm.ServerResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "控制层示例")
@Slf4j
@RequestMapping("/demo/")
@Validated
public class DemoController {


    @ApiOperation("示例接口")
    @GetMapping("heihei")
    public ServerResponse heihei(@NotBlank(message = "userName不能为空") @RequestParam("userName")String userName){
        return ServerResponse.createBySuccessMessage("hello world "+userName);
    }
}
